<%@page isELIgnored="false"%>
<link href="/css/css.css" rel="stylesheet" type="text/css">

 <script language="javascript">    
 
 	function paginationSkipTo(toUrl,referenceId) {
	 	var referenceTextBox = (document.getElementById) ? document.getElementById(referenceId)
                                   : document.all[referenceId];
      var reg=/\d/;
      try {
      	if (referenceTextBox == null || referenceTextBox.value.length==0){
	      	alert("<fmt:message key='page.skip.alert.empty'/>");
      		return;
      	}
      } catch(e){
      		alert("<fmt:message key='page.skip.alert.empty'/>");
       		return;
      }
      var isNumber = reg.exec(referenceTextBox.value);
      if (!isNumber) {
      	alert("<fmt:message key='page.skip.alert.number'/>");
      	return;
      }
      var number = 1;
       try {
       		number = parseInt(referenceTextBox.value,10);
       } catch(e){
       		alert("<fmt:message key='page.skip.alert.exception'/>");
       		return;
       }
       if (number<1){
       	alert("<fmt:message key='page.skip.alert.small'/>");
       	return;
       }
       if (number>"<c:out value='${pagination.totalPages}'/>"){
       	alert("<fmt:message key='page.skip.alert.big'/>");
       	return;
       }
       window.location=toUrl+number;
 	}
    
    function pagination_onkeypress(toUrl) {

    
    	if (window.event.keyCode==13){
    
    		paginationSkipTo(toUrl,'skipPageNumberTextBox');
    	} 
    }
 </script> 

<table border="0" cellpadding="0" cellspacing="0" class="page">
            <tr>
             
              <td align="left">
			  <c:if test="${pagination.currentPage <= 1}"><fmt:message key="page.first"/></c:if> <c:if test="${pagination.currentPage > 1}"><a href="<c:out value='${firstUrl}'/>"><fmt:message key="page.first"/> </a></c:if>
			  &nbsp;&nbsp;&nbsp;&nbsp;
			  <c:if test="${pagination.currentPage <= 1}"><fmt:message key="page.before"/></c:if> <c:if test="${pagination.currentPage > 1}"><a href="<c:out value='${previousUrl}'/>"> <fmt:message key="page.before"/></a></c:if>
			  &nbsp;&nbsp;&nbsp;&nbsp;
			  <c:if test="${pagination.currentPage < pagination.totalPages}"><a href="<c:out value='${nextUrl}'/>"> <fmt:message key="page.after"/> </a></c:if> <c:if test="${pagination.currentPage == pagination.totalPages}"><fmt:message key="page.after"/> </c:if>
			  &nbsp;&nbsp;&nbsp;&nbsp;
			  <c:if test="${pagination.currentPage < pagination.totalPages}"><a href="<c:out value='${lastUrl}'/>"><fmt:message key="page.last"/></a></c:if> <c:if test="${pagination.currentPage == pagination.totalPages}"><fmt:message key="page.last"/></c:if>
			 
			  <fmt:message key="page.yeci"/> <c:out value='${pagination.currentPage}'/>/
                        <c:out value='${pagination.totalPages}'/><fmt:message key="page.yegongyou"/><c:out value='${pagination.totalRows}'/><fmt:message key="page.tiao"/> <c:out value='${pagination.numPerPage}'/><fmt:message key="page.tiaoye"/>
             </td>
             
            </tr>
        </table>
       

		